package com.cookie.lib_network.impl

import com.cookie.lib_network.HttpManager
import com.cookie.lib_network.bean.*
import com.cookie.lib_network.http.HttpUrl
import okhttp3.RequestBody
import okhttp3.ResponseBody
import retrofit2.Call
import retrofit2.http.*

/**
 *   文件名:    HttpImplService
 *   创建者:    cookie
 *   创建时间:   2020/10/19 17:36
 *   描述:      接口服务
 */
interface HttpImplService {

    //随机笑话
    @GET(HttpUrl.JOKE_ONE_ACTION)
    fun queryJoke(@Query("key") key: String): Call<JokeOneData>

    //笑话列表
    @GET(HttpUrl.JOKE_LIST_ACTION)
    fun queryJokeList(
        @Query("key") key: String,
        @Query("page") page: Int,
        @Query("pagesize") pageSize: Int
    ): Call<JokeListData>

    //查询天气
    @GET(HttpUrl.WEATHER_ACTION)
    fun getWeather(@Query("city") city: String, @Query("key") key: String): Call<ResponseBody>

    @GET(HttpUrl.CONSTELL_ACTION)
    fun queryTodayConstellInfo(
        @Query("consName") consName: String,
        @Query("type") type: String,
        @Query("key") key: String
    ): Call<ToadyData>

    @GET(HttpUrl.CONSTELL_ACTION)
    fun queryWeekConstellInfo(
        @Query("consName") consName: String,
        @Query("type") type: String,
        @Query("key") key: String
    ): Call<WeekData>

    @GET(HttpUrl.CONSTELL_ACTION)
    fun queryMonthConstellInfo(
        @Query("consName") consName: String,
        @Query("type") type: String,
        @Query("key") key: String
    ): Call<MonthData>

    @GET(HttpUrl.CONSTELL_ACTION)
    fun queryYearConstellInfo(
        @Query("consName") consName: String,
        @Query("type") type: String,
        @Query("key") key: String
    ): Call<YearData>

    @Headers(HttpManager.JSON)
    @POST(HttpUrl.ROBOT_ACTION)
    fun aiRobot(@Body requestBody: RequestBody): Call<RobotData>

}